package com.周阳.中介者模式.机长塔台案例;


/**
 * 具体中介者：塔台
 */
public class ControllerTower extends TowerInterface {


    /**
     * 接受机长的请求
     */
    @Override
    public void acceptRequest(Captain captain,String action){
        if ("fly".equals(action)||"land".equals(action)){
            if (canDo){
                System.out.println("允许"+action);
                canDo=false;
            }else {
                System.out.println("不允许"+action);
            }
        }
        if ("success".equals(action)){
            canDo=true;
        }

    }
}


